﻿using Microsoft.AspNetCore.SignalR;

namespace ORS.OrderRobot.Service.Helper
{
    public static class MsgHelper
    {
        /// <summary>
        /// 消息发送
        /// </summary>
        /// <param name="hubContext"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static Task SendAsync(IHubContext<MessageHub> hubContext, MsgData msg)
        {
            _ = hubContext.Clients.All.SendAsync(Consts.SignalRMethod, msg.ToString(), msg.Type, DateTime.Now.China(),msg.Category);
            return Task.CompletedTask;
        }
    }
}

